import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd

# # 显式调用set()获取默认绘图
# sns.set()
# # 确定随机数生成器的种子
# np.random.seed(0)
# # 生成随机数组
# arr = np.random.randn(100)
# # 生成10个块
# ax = sns.distplot(arr, bins=10)
# plt.show()

# data = np.random.randint(0, 100, 500)
# # 绘制核密度估计曲线
# sns.displot(data, kind='kde', rug=True)
# # sns.displot(data, hist=False, rug=True)
# plt.show()

# dataframe = pd.DataFrame({"x": np.random.randn(500), "y": np.random.randn(500)})
# # 绘制散布图
# sns.jointplot(x="x", y="y", data=dataframe)
# plt.show()

dataframe = pd.DataFrame({"x": np.random.randn(500), "y": np.random.randn(500)})
# # 绘制二维直方图
# sns.jointplot(x="x", y="y", data=dataframe, kind="hex")
# 核密度估计
# sns.jointplot(x="x", y="y", data=dataframe, kind="kde")

dataset = sns.load_dataset("tips")
sns.pairplot(dataset)

plt.show()
